///===============================================
///=  THIS FILE CODES VARIABLES FOR THE 2006-12  =
///=  ISSUES, PID, BELIEF, & BEHAVIOR VARIABLES. =
///=  I THEN RUN ALL OF THE MODELS AND FIGURES.  = 
///=  DATA CLEANED ON 7/05/16 BY PAUL GOREN.     = 
///===============================================
version 13.1
use "c:\Nat Surveys\pals0612.dta", clear


/// ============================
/// = CODING OF ALL VARIABLES  =
/// ============================
/// pid 2006
fre po_party_w1
gen pid06=po_party_w1
replace pid06=(pid06-1)/6
replace pid06=. if po_party_w1==-7
replace pid06=. if po_party_w1==-4
label define PID 0 "Strong Democrat" 1 "Strong Republican" 
label variable pid06 "PID 06"
label value pid06 PID
fre pid06

/// pid 2012
fre po_party_w2
gen pid12=po_party_w2
replace pid12=(pid12-1)/6
replace pid12=. if po_party_w2==-7
replace pid12=. if po_party_w2==-4
label variable pid12 "PID 12"
label value pid12 PID
fre pid12


/// relcom 2006
fre rm_1_w1
gen relcom1_06=rm_1_w1
replace relcom1_06=(relcom1_06-1)/4
replace relcom1_06=. if rm_1_w1==-4
label define relcom 0 "not al all" 1 "most imp" 
label variable relcom1_06 "how imp rel?"
label value relcom1_06 relcom
fre relcom1_06

fre rm_2_w1
gen relcom2_06=rm_2_w1
replace relcom2_06=(relcom2_06-1)/4
replace relcom2_06=. if rm_2_w1==-4
label variable relcom2_06 "how imp God?"
label value relcom2_06 relcom
fre relcom2_06

fre ci_0_w1
gen relcom3_06=ci_0_w1
replace relcom3_06=(relcom3_06-1)/7
replace relcom3_06=. if ci_0_w1==-7
replace relcom3_06=. if ci_0_w1==-4
label define attend 0 "never" 1 "> 3 times wk" 
label variable relcom3_06 "how often attend worship?"
label value relcom3_06 attend
fre relcom3_06

fre arbl_12_w1
gen relcom4_06=arbl_12_w1
replace relcom4_06=(relcom4_06-1)/6
replace relcom4_06=. if arbl_12_w1==-7
replace relcom4_06=. if arbl_12_w1==-4
label define grace 0 "never" 1 "> once day" 
label variable relcom4_06 "pray at meals?"
label value relcom4_06 grace
fre relcom4_06

fre arbl_13_w1
gen relcom5_06=arbl_13_w1
replace relcom5_06=(relcom5_06-1)/6
replace relcom5_06=. if arbl_13_w1==-7
replace relcom5_06=. if arbl_13_w1==-4
label define pray 0 "never" 1 "> 3x day" 
label variable relcom5_06 "how often pray?"
label value relcom5_06 grace
fre relcom5_06

/// polychoric relcom1_06 relcom2_06 relcom3_06 relcom4_06 relcom5_06
display (.644*5)/(1+.645*4)
egen relcom06miss=rowmiss(relcom1_06 relcom2_06 relcom3_06 relcom4_06 relcom5_06)
egen relcom06=rowmean(relcom1_06 relcom2_06 relcom3_06 relcom4_06 relcom5_06) if relcom06miss<3
label variable relcom06 "rel commitment index"
label define relcomindex 0 "very weak" 1 "very strong"
label value relcom06 relcomindex
fre relcom06miss relcom06

/// relcom 2012
fre rm_1_w2
gen relcom1_12=rm_1_w2
replace relcom1_12=(relcom1_12-1)/4
replace relcom1_12=. if rm_1_w2==777
label variable relcom1_12 "how imp rel?"
label value relcom1_12 relcom
fre relcom1_12

fre rm_2_w2
gen relcom2_12=rm_2_w2
replace relcom2_12=(relcom2_12-1)/4
label variable relcom2_12 "how imp God?"
label value relcom2_12 relcom
fre relcom2_12

fre ci_0_w2
gen relcom3_12=ci_0_w2
replace relcom3_12=(relcom3_12-1)/7
replace relcom3_12=. if ci_0_w2==888
label variable relcom3_12 "how often attend worship?"
label value relcom3_12 attend
fre relcom3_12

fre arbl_12_w2
gen relcom4_12=arbl_12_w2
replace relcom4_12=(relcom4_12-1)/6
replace relcom4_12=. if arbl_12_w2==888
replace relcom4_12=. if arbl_12_w2==999
label variable relcom4_12 "pray at meals?"
label value relcom4_12 grace
fre relcom4_12

fre arbl_13_w2
gen relcom5_12=arbl_13_w2
replace relcom5_12=(relcom5_12-1)/6
replace relcom5_12=. if arbl_13_w2==777
replace relcom5_12=. if arbl_13_w2==888
label variable relcom5_12 "how often pray?"
label value relcom5_12 grace
fre relcom5_12

/// polychoric relcom1_12 relcom2_12 relcom3_12 relcom4_12 relcom5_12
display (.689*5)/(1+.689*4)
egen relcom12miss=rowmiss(relcom1_12 relcom2_12 relcom3_12 relcom4_12 relcom5_12)
egen relcom12=rowmean(relcom1_12 relcom2_12 relcom3_12 relcom4_12 relcom5_12) if relcom12miss<3
label variable relcom12 "rel commitment index"
label value relcom12 relcomindex
fre relcom12miss relcom12


/// orthodox 2006
fre ara_1_w1
gen orthodox1_06=ara_1_w1 
replace orthodox1_06=1-(orthodox1_06-1)/4
replace orthodox1_06=. if ara_1_w1==-7
replace orthodox1_06=. if ara_1_w1==-4
label define agree 0 "strg agree" 1 "strg disagree" 
label variable orthodox1_06 "Moral errors in good book"
label value orthodox1_06 agree
fre orthodox1_06

fre  ara_1b_w1
gen orthodox2_06= ara_1b_w1 
replace orthodox2_06=1-(orthodox2_06-1)/4
replace orthodox2_06=. if ara_1b_w1==-7
replace orthodox2_06=. if ara_1b_w1==-4
label variable orthodox2_06 "sci/hist errors in good book"
label value orthodox2_06 agree
fre orthodox2_06

fre  arbl_3_w1
gen orthodox3_06= arbl_3_w1 
replace orthodox3_06=1-(orthodox3_06-1)/2
replace orthodox3_06=. if arbl_3_w1==-7 | arbl_3_w1==-4 | arbl_3_w1==4
label define inspire 0 "no" 1 "yes"
label variable orthodox3_06 "Book inspired by God"
label value orthodox3_06 inspire
fre orthodox3_06

/// polychoric orthodox1_06 orthodox2_06 orthodox3_06
display (3*.664)/(1+.664*2)
egen orthodox06miss=rowmiss(orthodox1_06 orthodox2_06 orthodox3_06)
egen orthodox06=rowmean(orthodox1_06 orthodox2_06 orthodox3_06) if orthodox06miss<2
label define orthodoxyindex 0 "ext low" 1 "ext high"
label variable orthodox06 "rel orthodoxy index"
label value orthodox06 orthodoxy06
fre orthodox06miss orthodox06


/// orthodox 2012
fre ara_1_w2
gen orthodox1_12=ara_1_w2 
replace orthodox1_12=1-(orthodox1_12-1)/4
replace orthodox1_12=. if ara_1_w2==777 | ara_1_w2==888 | ara_1_w2==999
label variable orthodox1_12 "Moral errors in good book"
label value orthodox1_12 agree
fre orthodox1_12

fre  ara_1b_w2
gen orthodox2_12= ara_1b_w2 
replace orthodox2_12=1-(orthodox2_12-1)/4
replace orthodox2_12=. if ara_1b_w2==777 | ara_1b_w2==888 | ara_1b_w2==999
label variable orthodox2_12 "sci/hist errors in good book"
label value orthodox2_12 agree
fre orthodox2_12

fre  arbl_3_w2
gen orthodox3_12= arbl_3_w2 
replace orthodox3_12=1-(orthodox3_12-1)/2
replace orthodox3_12=. if arbl_3_w2==777 | arbl_3_w2==888 | arbl_3_w2==999 | arbl_3_w2==4
label variable orthodox3_12 "Book inspired by God"
label value orthodox3_12 inspire
fre orthodox3_12

/// polychoric orthodox1_12 orthodox2_12 orthodox3_12
display (3*.680)/(1+.680*2)
egen orthodox12miss=rowmiss(orthodox1_12 orthodox2_12 orthodox3_12)
egen orthodox12=rowmean(orthodox1_12 orthodox2_12 orthodox3_12) if orthodox12miss<2
label variable orthodox12 "rel orthodoxy index"
label value orthodox12 orthodoxy12
fre orthodox12miss orthodox12


/// moralissuess: abortion 2006
fre ama_1_w1
gen moralissues1_06=ama_1_w1
replace moralissues1_06=(moralissues1_06-1)/4
replace moralissues1_06=. if ama_1_w1==-7 | ama_1_w1==-4
label variable moralissues1_06 "gay marriage"
label define support 0 "support" 1 "oppose" 
label value moralissues1_06 support
fre moralissues1_06

fre  ma_1_w1
gen moralissues2_06= ma_1_w1
replace moralissues2_06=1-(moralissues2_06-1)/4
replace moralissues2_06=.5 if ma_1_w1==6
replace moralissues2_06=. if ma_1_w1==-7 | ma_1_w1==-4
label variable moralissues2_06 "abort morally wrong fetus could survive"
label define always 0 "never" 1 "always" 
label value moralissues2_06 always
fre moralissues2_06

fre  ma_9_w1
gen moralissues3_06= ma_9_w1
replace moralissues3_06=(moralissues3_06-1)/4
replace moralissues3_06=.5 if ma_9_w1==6
replace moralissues3_06=. if ma_9_w1==-7 | ma_9_w1==-4 
label variable moralissues3_06 "abortion legal" 
label define legal 0 "almost always" 1 "never" 
label value moralissues3_06 legal
fre moralissues3_06

fre ma_4_w1
gen moralissues4_06=ma_4_w1
replace moralissues4_06=1-(moralissues4_06-1)/4
replace moralissues4_06=.5 if ma_4_w1==6
replace moralissues4_06=. if ma_4_w1==-7 | ma_4_w1==-4
label variable moralissues4_06 "genetic eng baby"
label value moralissues4_06 always
fre moralissues4_06

/// polychoric moralissues1_06 moralissues2_06 moralissues3_06 moralissues4_06
display (4*.368)/(1+.368*3)
egen moralissues06miss=rowmiss(moralissues1_06 moralissues2_06 moralissues3_06 moralissues4_06)
egen moralissues06=rowmean(moralissues1_06 moralissues2_06 moralissues3_06 moralissues4_06) if moralissues06miss<2
label define moralissuesindex 0 "ext lib" 1 "ext con"
label variable moralissues06 "rel moral issuess index"
label value moralissues06 moralissuesindex
fre moralissues06miss moralissues06


/// moralissues 2012
fre ama_1_w2
gen moralissues1_12=ama_1_w2
replace moralissues1_12=(moralissues1_12-1)/4
replace moralissues1_12=. if ama_1_w2==777 | ama_1_w2==888
label variable moralissues1_12 "gay marriage"
label value moralissues1_12 support
fre moralissues1_12

fre  ma_1_w2
gen moralissues2_12= ma_1_w2
replace moralissues2_12=1-(moralissues2_12-1)/4
replace moralissues2_12=.5 if ma_1_w2==6 
replace moralissues2_12=. if ma_1_w2==777 | ma_1_w2==888 | ma_1_w2==999 | ma_1_w2==7
label variable moralissues2_12 "abort morally wrong fetus could survive"
label value moralissues2_12 always
fre moralissues2_12

fre  ma_9_w2
gen moralissues3_12= ma_9_w2
replace moralissues3_12=(moralissues3_12-1)/4
replace moralissues3_12=.5 if ma_9_w2==6
replace moralissues3_12=. if ma_9_w2==7 | ma_9_w2== 777 | ma_9_w2== 888 | ma_9_w2== 999
label variable moralissues3_12 "abortion legal" 
label value moralissues3_12 legal
fre moralissues3_12

fre ma_4_w2
gen moralissues4_12=ma_4_w2
replace moralissues4_12=1-(moralissues4_12-1)/4
replace moralissues4_12=.5 if ma_4_w2==6
replace moralissues4_12=. if ma_4_w2==7 | ma_4_w2==777 | ma_4_w2==888 | ma_4_w2==999
label variable moralissues4_12 "genetic eng baby"
label value moralissues4_12 always
fre moralissues4_12

/// polychoric moralissues1_12 moralissues2_12 moralissues3_12 moralissues4_12
display (4*.448)/(1+.448*3)
egen moralissues12miss=rowmiss(moralissues1_12 moralissues2_12 moralissues3_12 moralissues4_12)
egen moralissues12=rowmean(moralissues1_12 moralissues2_12 moralissues3_12 moralissues4_12) if moralissues12miss<2
label variable moralissues12 "rel moral issuess index"
label value moralissues12 moralissuesindex
fre moralissues12miss moralissues12


/// controls
/// black
fre race_all_w1
gen black=race_all_w1
recode black 1=0 2=1 3/5=0  
label define black 1 "black" 0 "non-black" 
label value black black
fre black

/// age
fre  hr_age_w1
gen age= hr_age_w1
fre age

/// female
fre hr_gender_w1
gen female=hr_gender_w1
recode female 1=0 0=1
fre female

/// college
fre dm_2_w1
gen college=dm_2_w1
recode college -7/-4=. 1/5=0 6/11=1 12=0
label variable college "college grad?"
label define yes 0 "no" 1 "yes" 
label value college yes
fre college


/// ===================================
/// = TABLE 1: STABILITY ESTIMATES.   =  
/// ===================================
svyset psu_id [pweight= loweight_w2rake]
regress moralissues12 moralissues06 [pweight= loweight_w2rake], cformat(%4.2f) beta
regress pid12 pid06 [pweight= loweight_w2rake], cformat(%4.2f) beta
regress orthodox12 orthodox06 [pweight= loweight_w2rake], cformat(%4.2f) beta
regress relcom12 relcom06 [pweight= loweight_w2rake], cformat(%4.2f) beta


/// ======================================================
/// = FIGURE 1 & TABLE E: DV = PID12, IV = MORALISSUES06 =  
/// ====================================================== 
svy: regress pid12 moralissues06 pid06 orthodox06 relcom06 age female black college, cformat(%4.2f) 
margins, at(moralissues06=(0(.1)1) female=1 black=0 college=0)
marginsplot, ///
  name(pid0612, replace) ///
  plotopts(mcolor(black)) ciopts(lcolor(black)) ///
  title("", margin(tiny)) ///
  title(2006-12 PALS, size(large) ring(0)) ///
  xsize(5) ///
  xtitle("2006 Culture War Position", size(medlarge) margin(zero)) ///
  xlabel(0 "Progressive" .99 "Orthodox", noticks labsize(medium)) ///
  ysize(5) ///
  ytitle("2012 Party ID", size(medlarge) margin(zero)) ///
  ylabel(0 "Strg Dem" .50 "Indp" 1 "Strg Rep", noticks labsize(medium) angle(0)) ///
  yline(.50, lpattern(shortdash))  ///
  yline(.50, lpattern(shortdash)) ///
  text(.11 .95 "b = 0.22", size(medium)) ///
  text(.04 .95 "{it:t} = 2.80", size(medium)) ///
  scale(.5) aspectratio(1) ///
  scheme(s1mono) ///
  plotregion(lcolor(white))   

graph save pid0612 "C:\Graphs\pid0612.gph", replace  
  
graph combine pid9296 pid0610 pid0812 pid0612, ///
  name(figure1, replace) ///
  title("Figure 1: Effect of Culture War Positions{sub:t-1} on PID{sub:t} across 4 Panels", size(small)) ///
  note(Notes: Point estimates bounded by 95% confidence intervals. Estimates derived from model 2 in Tables B-E., position(6) size(vsmall)) ///
  plotregion(lcolor(white))   


/// ======================================================
/// = FIGURE 2 & TABLE E: DV = MORALISSUES06, IV = PID12 =  
/// ======================================================   
svy: regress moralissues12 moralissues06 pid06 orthodox06 relcom06 age female black college, cformat(%4.2f) 
margins, at(pid06=(0(.1)1) female=1 black=0 college=0)
marginsplot, ///
  name(cw0612p, replace) ///
  plotopts(mcolor(black)) ciopts(lcolor(black)) ///
  title(2006-12 PALS, size(large) ring(0)) ///
  xsize(5) ///
  xtitle("2006 Party ID", size(medlarge) margin(zero)) ///
  xlabel(0 "Strg Dem" .98 "Strg Rep", noticks labsize(medium)) ///
  ysize(5) ///
  ytitle("2012 Culture War Position", size(medlarge) margin(zero)) ///
  ylabel(0 "Prog" 1 "Ortho", noticks labsize(medium) angle(0)) ///
  yline(.50, lpattern(shortdash))  ///
  text(.11 .95 "b = 0.06", size(medium)) ///
  text(.04 .95 "{it:t} = 2.49", size(medium)) ///
  scale(.5) aspectratio(1) ///
  scheme(s1mono) ///
  plotregion(lcolor(white))   

graph save cw0612p "C:\Graphs\cw0612p.gph", replace  

graph combine cw9296p cw0610p cw0812p cw0612p, ///
  name(figure2, replace) ///
  title("Figure 2: Effect PID{sub:t-1} on Culture War Positions{sub:t} across 4 Panels", size(small)) /// 
  note(Notes: Point estimates bounded by 95% confidence intervals. Estimates derived from model 1 in Tables B-E., position(6) size(vsmall)) ///
  plotregion(lcolor(white))   
 
 
/// ===========================================================
/// = FIGURE 3 & TABLE E: DV = ORTHODOX12, IV = MORALISSUES06 =  
/// =========================================================== 
svy: regress orthodox12 moralissues06 pid06 orthodox06 relcom06 age female black college, cformat(%4.2f) 
margins, at(moralissues06=(0(.1)1) female=1 black=0 college=0)
marginsplot, ///
  name(ortho0612, replace) ///
  plotopts(mcolor(black)) ciopts(lcolor(black)) ///
  title(2006-12 PALS, size(large) ring(0)) ///
  xtitle("2006 Culture War Position", size(medlarge) margin(zero)) ///
  xlabel(0 "Progressive" .99 "Orthodox", noticks labsize(medium)) ///
  ytitle("2012 Biblical Inerrancy", size(medlarge) margin(zero)) ///
  ylabel(0 "Errors" 1 "No errors", noticks labsize(medium) angle(0)) ///
  yline(.50, lpattern(shortdash))  ///
  text(.11 .95 "b = 0.13", size(medium)) ///
  text(.04 .95 "{it:t} = 2.72", size(medium)) ///
  scale(.5) aspectratio(1) ///
  scheme(s1mono) ///
  plotregion(lcolor(white))  
  
graph save ortho0612 "C:\Graphs\ortho0612.gph", replace  

graph combine ortho9296 ortho0610 ortho0812 ortho0612, ///
  name(figure3, replace) ///
  title("Figure 3: Effect of Culture War Positions{sub:t-1} on Religious Belief{sub:t} across 4 Panels", size(small)) /// 
  note(Notes: Point estimates bounded by 95% confidence intervals. Estimates derived from model 3 in Tables B-E., position(6) size(vsmall)) ///
  plotregion(lcolor(white))


/// ============================================================
/// = FIGURE 4 & TABLE E: DV = MORALISSUES12, IV = ORTHODOX06  =  
/// ============================================================ 
svy: regress moralissues12 moralissues06 pid06 orthodox06 relcom06 age female black college, cformat(%4.2f) 
margins, at(orthodox06=(0(.1)1) female=1 black=0 college=0)
marginsplot, ///
  name(cw0612o, replace) ///
  plotopts(mcolor(black)) ciopts(lcolor(black)) ///
  title(2006-12 PALS, size(large) ring(0)) ///
  xsize(5) ///
  xtitle("2006 Biblical Inerrancy", size(medlarge) margin(zero)) ///
  xlabel(0 "Errors" .98 "No errors", noticks labsize(medium)) ///
  ysize(5) ///
  ytitle("2012 Culture War Position", size(medlarge) margin(zero)) ///
  ylabel(0 "Prog" 1 "Ortho", noticks labsize(medium) angle(0)) ///
  yline(.50, lpattern(shortdash))  /// 
  text(.11 .95 "b = 0.18", size(medium)) ///
  text(.04 .95 "{it:t} = 7.01", size(medium)) ///
  scale(.5) aspectratio(1) ///
  scheme(s1mono) ///
  plotregion(lcolor(white))  
  
graph save cw0612o "C:\Graphs\cw0612o.gph", replace  

graph combine cw9296o cw0610o cw0812o cw0612o, ///
  name(figure4, replace) ///
  title("Figure 4: Effect of Religious Belief{sub:t-1} on Culture War Positions{sub:t} across 4 Panels", size(small)) /// 
  note(Notes: Point estimates bounded by 95% confidence intervals. Estimates derived from model 1 in Tables B-E., position(6) size(vsmall)) ///
  plotregion(lcolor(white))  
  
    
/// =========================================================
/// = FIGURE 5 & TABLE E: DV = RELCOM12, IV = MORALISSUES08 =  
/// ========================================================= 
svy: regress relcom12 moralissues06 pid06 orthodox06 relcom06 age female black college, cformat(%4.2f) 
margins, at(moralissues06=(0(.1)1) female=1 black=0 college=0)
marginsplot, ///
  name(relcom0612, replace) ///
  plotopts(mcolor(black)) ciopts(lcolor(black)) ///
  title(2006-12 PALS, size(large) ring(0)) ///
  xsize(5) ///  
  xtitle("2006 Culture War Position ", size(medlarge) margin(zero)) ///
  xlabel(0 "Progressive" .99 "Orthodox", noticks labsize(medium)) ///
  ytitle("2012 Religious Commitment", size(medlarge) margin(zero)) ///
  ylabel(0 "Weak" 1 "Strong", noticks labsize(medium) angle(0)) ///
  yline(.50, lpattern(shortdash)) ///
  text(.11 .95 "b = 0.08", size(medium)) ///
  text(.04 .95 "{it:t} = 2.44", size(medium)) ///
  scale(.5) aspectratio(1) ///
  scheme(s1mono) ///
  plotregion(lcolor(white))  
  
graph save relcom0612 "C:\Graphs\relcom0612.gph", replace

graph combine relcom9296  relcom0610 relcom0812 relcom0612, ///
  name(figure5, replace) ///
  title("Figure 5: Effect of Culture War Positions{sub:t-1} on Religious Commitment{sub:t} across 4 Panels", size(small)) /// 
  note(Notes: Point estimates bounded by 95% confidence intervals. Estimates derived from model 4 in Tables B-E., position(6) size(vsmall)) ///
  plotregion(lcolor(white))  
 

/// ==========================================================
/// = FIGURE 6 & TABLE E: DV = MORALISSUES12, IV = RELCOM06  =  
/// ==========================================================   
svy: regress moralissues12 moralissues06 pid06 orthodox06 relcom06 age female black college, cformat(%4.2f) 
margins, at(relcom06=(0(.1)1) female=1 black=0 college=0)
marginsplot, ///
  name(cw0612r, replace) ///
  plotopts(mcolor(black)) ciopts(lcolor(black)) ///
  title(2006-12 PALS, size(large) ring(0)) ///
  xsize(5) ///    
  xtitle("2006 Religious Commitment", size(medlarge) margin(zero)) ///
  xlabel(0 "Weak" .98 "Strong", noticks labsize(medium)) ///
  ysize(5) ///
  ytitle("2012 Culture War Position", size(medlarge) margin(zero)) ///
  ylabel(0 "Prog" 1 "Ortho", noticks labsize(medium) angle(0)) ///
  yline(.50, lpattern(shortdash))  ///
  text(.11 .95 "b = 0.13", size(medium)) ///
  text(.04 .95 "{it:t} = 3.64", size(medium)) ///
  scale(.5) aspectratio(1) ///
  scheme(s1mono) ///
  plotregion(lcolor(white))  
  
graph save relcom0612 "C:\Graphs\relcom0612.gph", replace

graph combine cw9296r cw0610r cw0812r cw0612r, ///
  name(figure6, replace) ///
  title("Figure 6: Effect of Religious Commitment{sub:t-1} on Culture War Positions{sub:t} across 4 Panels", size(small)) /// 
  note(Notes: Point estimates bounded by 95% confidence intervals. Estimates derived from model 1 in Tables B-E., position(6) size(vsmall)) ///
  plotregion(lcolor(white))  
  
  
/// ==============================================
/// = SUPPLEMENTAL MATERIALS: ON-LINE APPENDICES =  
/// ==============================================


/// ======================================================
/// = TABLE A: DESCRIPTIVE STATISTICS FOR KEY VARIABLES =  
/// =====================================================
summ moralissues06 pid06 orthodox06 relcom06
summ moralissues12 pid12 orthodox12 relcom12


/// =============================
/// = FIGURE A: Kernal Desnity  =  
/// ============================= 
twoway(kdensity moralissues06, lcolor(red) lwidth(medium) kernel(gaussian) bwidth(.075)) /// 
 (kdensity moralissues12, lcolor(blue) lwidth(medium) kernel(gaussian) bwidth(.075)), ///
 name(cw06126density, replace) ///
 title("2006-12 PALS", size(medsmall) ring(0)) ///
 ytitle("Density", size(medsmall) margin(zero)) ///
 ylabel(.00 " " 1.5 " ", labsize(small) angle(zero) tstyle(major_notick)) ///
 xlabel(0 "Progressive" .97 "Orthodox", labsize(small) tstyle(major_notick)) ///
 xtitle("Position on Culture War Issues", size(medsmall) margin(zero)) ///
 legend(on order(1 "2006" 2 "2012") cols(2) ring(0)) ///
 plotregion(lcolor(white)) ///
 scheme(s1mono)
 
graph save cw06126density "C:\Graphs\cw06126density.gph", replace

graph combine cw9296density cw0610density cw0812density cw06126density, ///
  name(figureA1, replace) ///
  title("Figure A: Smoothed Histograms for Culture War Distributions across 4 Panels", size(small)) /// 
  plotregion(lcolor(white))  

 
/// ==============================================================
/// = TABLE H ROBUSTNESS CHECK ABORTION & GAY RIGHTS ON PARTY ID =  
/// ==============================================================
/// 1 item used to measure gay rights
/// 3 items used to measure abortion 
egen abortion06miss=rowmiss(moralissues2_06 moralissues3_06 moralissues4_06)
egen abortion06=rowmean(moralissues2_06 moralissues3_06 moralissues4_06) if moralissues06miss<2
fre abortion06

svy: regress pid12 moralissues06 pid06 orthodox06 relcom06 age female black college, cformat(%4.2f) 
svy: regress pid12 abortion06 pid06 orthodox06 relcom06 age female black college, cformat(%4.2f) 
svy: regress pid12 moralissues1_06 pid06 orthodox06 relcom06 age female black college, cformat(%4.2f)  
svy: regress pid12 abortion06 moralissues1_06 pid06 orthodox06 relcom06 age female black college, cformat(%4.2f)


/// ==============================================================
/// = TABLE I ROBUSTNESS CHECK ABORTION & GAY RIGHTS ON ORTHODOX =  
/// ==============================================================
svy: regress orthodox12 moralissues06 pid06 orthodox06 relcom06 age female black college, cformat(%4.2f) 
svy: regress orthodox12 abortion06 pid06 orthodox06 relcom06 age female black college, cformat(%4.2f)  
svy: regress orthodox12 moralissues1_06 pid06 orthodox06 relcom06 age female black college, cformat(%4.2f) 
svy: regress orthodox12 abortion06 moralissues1_06 pid06 orthodox06 relcom06 age female black college, cformat(%4.2f)


/// =============================================================
/// = TABLE J ROBUSTNESS CHECK: ABORTION & GAY RIGHTS ON RELCOM =  
/// =============================================================
svy: regress relcom12 moralissues06 pid06 orthodox06 relcom06 age female black college, cformat(%4.2f) 
svy: regress relcom12 abortion06 pid06 orthodox06 relcom06 age female black college, cformat(%4.2f)  
svy: regress relcom12 moralissues1_06 pid06 orthodox06 relcom06 age female black college, cformat(%4.2f) 
svy: regress relcom12 abortion06 moralissues1_06 pid06 orthodox06 relcom06 age female black college, cformat(%4.2f)


/// ============================================================
/// = TABLE M ROBUSTNESS CHECK: SYMBOLIC IDEOLOGY ON ALL 4 DVS =  
/// ============================================================
/// ideo: based on 7-pt scale 
fre po_1_w1
gen ideo06=po_1_w1
recode ideo06 -7/-4=. 1=0 2=.25 3=.5 4=.75 5=1 6=.
label variable ideo06 "Ideo ID"
label define ideo06 0 "ext lib" 1 "ext con"
label value ideo06 ideo06
fre ideo06

svy: regress moralissues12 moralissues06 pid06 orthodox06 relcom06 age female black college ideo06 
svy: regress pid12 moralissues06 pid06 orthodox06 relcom06 age female black college ideo06
svy: regress orthodox12 moralissues06 pid06 orthodox06 relcom06 age female black college ideo06
svy: regress relcom12 moralissues06 pid06 orthodox06 relcom06 age female black college ideo06


/// =============================================================
/// = TABLE N ROBUSTNESS CHECK: RELIGIOUS IDEOLOGY ON ALL 4 DVS =  
/// =============================================================
/// ideo: based on 7-pt scale 
fre ri_conslib_w1
gen relideo06=ri_conslib_w1
recode relideo06 -7/-4=.
replace relideo06=(8-relideo06-1)/6
label variable relideo06 "Religious ideo ID"
label define relideo06 0 "vry lib" 1 "vry con"
label value relideo06 relideo06
fre relideo06

svy: regress moralissues12 moralissues06 pid06 orthodox06 relcom06 age female black college relideo06 
svy: regress pid12 moralissues06 pid06 orthodox06 relcom06 age female black college relideo06
svy: regress orthodox12 moralissues06 pid06 orthodox06 relcom06 age female black college relideo06
svy: regress relcom12 moralissues06 pid06 orthodox06 relcom06 age female black college relideo06

 
/// ===========================================================
/// = TABLE O ROBUSTNESS CHECK: AUTHORITARIANISM ON ALL 4 DVS =  
/// ===========================================================
/// a potentially serviceable proxy
/// auth06
fre SE_5
gen auth06=SE_5
recode auth06 1=0 2=.25 3=.5 4=.75 5=1 0=. 888=.
label variable auth06 "ok to break moral rules get away with it"
label define auth06 0 "strg agree" 1 "strg disagree"
label value auth06 auth06
fre auth06

svy: regress moralissues12 moralissues06 pid06 orthodox06 relcom06 age female black college auth06 
svy: regress pid12 moralissues06 pid06 orthodox06 relcom06 age female black college auth06
svy: regress orthodox12 moralissues06 pid06 orthodox06 relcom06 age female black college auth06
svy: regress relcom12 moralissues06 pid06 orthodox06 relcom06 age female black college auth06


/// ===============================================================
/// = TABLE Q ROBUSTNESS CHECK: OPENNESS DISPOSITION ON ALL 4 DVS =  
/// ===============================================================
fre se_1_w1
gen open1_06=se_1_w1
recode open1_06 1=0 2=.25 3=.5 4=.75 5=1 0=. -4=.
label variable open1_06 "like to do things for thrill of it"
label define open06 0 "strg agree" 1 "strg disagree"
label value open1_06 open06
fre open1_06

fre se_3_w1
gen open2_06=se_3_w1
recode open2_06 1=0 2=.25 3=.5 4=.75 5=1 0=. -4=.
label variable open2_06 "like unpred situations"
label value open2_06 open06
fre open2_06

polychoric open1_06 open2_06
display (2*.404)/(1+.404*1)
gen open06=(open1_06+open2_06)/2
label variable open06 "openness disposition"
label define high 0 "open" 1 "closed"
label value open06 high
fre open06

svy: regress moralissues12 moralissues06 pid06 orthodox06 relcom06 age female black college open06
svy: regress pid12 moralissues06 pid06 orthodox06 relcom06 age female black college open06
svy: regress orthodox12 moralissues06 pid06 orthodox06 relcom06 age female black college open06
svy: regress relcom12 moralissues06 pid06 orthodox06 relcom06 age female black college open06


/// ===========================================
/// = TABLE R ROBUSTNESS CHECK: INTERACTIONS  =  
/// ===========================================
/// age
gen moral_age=moralissues06*age

svy: regress pid12 moralissues06 pid06 orthodox06 relcom06 age female black college moral_age, cformat(%4.2f) 
svy: regress orthodox12 moralissues06 pid06 orthodox06 relcom06 age female black college moral_age, cformat(%4.2f) 
svy: regress relcom12 moralissues06 pid06 orthodox06 relcom06 age female black college moral_age, cformat(%4.2f) 

/// pid
gen moral_pid=moralissues06*pid06
svy: regress pid12 moralissues06 pid06 orthodox06 relcom06 age female black college moral_pid, cformat(%4.2f) 
svy: regress orthodox12 moralissues06 pid06 orthodox06 relcom06 age female black college moral_pid, cformat(%4.2f) 
svy: regress relcom12 moralissues06 pid06 orthodox06 relcom06 age female black college moral_pid, cformat(%4.2f) 

/// education
svy: regress pid12 moralissues06 pid06 orthodox06 relcom06 age female black  ///
  i.college i.college#c.moralissues06   
  
svy: regress orthodox12 moralissues06 pid06 orthodox06 relcom06 age female black  ///
  i.college i.college#c.moralissues06   

svy: regress relcom12 moralissues06 pid06 orthodox06 relcom06 age female black  ///
  i.college i.college#c.moralissues06 


/// ===========================================
/// = TABLE S ROBUSTNESS CHECK: EVANGELICALS  =  
/// =========================================== 
fre reltrad_w1
svy: regress pid12 moralissues06 pid06 orthodox06 relcom06 age female black college if reltrad_w1==2, cformat(%4.2f)
svy: regress moralissues12 moralissues06 pid06 orthodox06 relcom06 age female black college if reltrad_w1==2, cformat(%4.2f)
svy: regress orthodox12 moralissues06 pid06 orthodox06 relcom06 age female black college if reltrad_w1==2, cformat(%4.2f)
svy: regress relcom12 moralissues06 pid06 orthodox06 relcom06 age female black college if reltrad_w1==2, cformat(%4.2f)


/// ========================================
/// = TABLE T ROBUSTNESS CHECK: CATHOLICS  =  
/// ======================================== 
fre reltrad_w1
svy: regress pid12 moralissues06 pid06 orthodox06 relcom06 age female black college if reltrad_w1==4, cformat(%4.2f)
svy: regress moralissues12 moralissues06 pid06 orthodox06 relcom06 age female black college if reltrad_w1==4, cformat(%4.2f)
svy: regress orthodox12 moralissues06 pid06 orthodox06 relcom06 age female black college if reltrad_w1==4, cformat(%4.2f)
svy: regress relcom12 moralissues06 pid06 orthodox06 relcom06 age female black college if reltrad_w1==4, cformat(%4.2f)


/// ============================================
/// = TABLE X ROBUSTNESS CHECK: EIV REGRESSION =  
/// ============================================
/// use pid estimate from 08-10-12 GSS analysis in Chen and Goren (2016) 

eivreg moralissues12 moralissues06 pid06 orthodox06 relcom06 age female black college, reliab(pid06 .88 orthodox06 .86 moralissues06 .70 relcom06 .90)
eivreg pid12 moralissues06 pid06 orthodox06 relcom06 age female black college, reliab(pid06 .88 orthodox06 .86 moralissues06 .70 relcom06 .90)
eivreg orthodox12 moralissues06 pid06 orthodox06 relcom06 age female black college, reliab(pid06 .88 orthodox06 .86 moralissues06 .70 relcom06 .90)
eivreg relcom12 moralissues06 pid06 orthodox06 relcom06 age female black college, reliab(pid06 .88 orthodox06 .86 moralissues06 .70 relcom06 .90)


/// ==============================================
/// = TABLE BB: ROBUSTNESS CHECK: IV REGRESSION =  
/// ==============================================
/// we use 2SLS for all models
/// 2SLS: pid 
svy: ivregress 2sls moralissues12 moralissues06 orthodox06 relcom06 age female black college (pid12 = pid06), cformat(%4.2f) 
svy: ivregress 2sls pid12 pid06  orthodox06 relcom06 age female black college (moralissues12= moralissues06), cformat(%4.2f) 

/// 2SLS: orthodox
svy: ivregress 2sls moralissues12 pid06 moralissues06 relcom06 age female black college (orthodox12 = orthodox06), cformat(%4.2f) 
svy: ivregress 2sls orthodox12 pid06 orthodox06 relcom06 age female black college (moralissues12 = moralissues06), cformat(%4.2f) 

/// 2SLS: relcom
svy: ivregress 2sls moralissues12 pid06 moralissues06 orthodox06 age female black college (relcom12 = relcom06), cformat(%4.2f) 
svy: ivregress 2sls relcom12 pid06 orthodox06 relcom06 age female black college (moralissues12 = moralissues06), cformat(%4.2f) 





